# Maintainer: Levente Polyak <anthraxx[at]archlinux[dot]org>
# Contributor: Eric Bélanger <eric@archlinux.org>

pkgname=gajim
_pkgver=1.7.3
#_fixupver=2
pkgver=${_pkgver}
#pkgver=${_pkgver}.r${_fixupver}
pkgrel=2
pkgdesc='Full featured and easy to use XMPP (Jabber) client'
url='https://gajim.org/'
arch=('any')
license=('GPL3')
depends=('gtk3' 'gtksourceview4' 'python-cairo' 'python-gobject' 'python-keyring' 'python-nbxmpp>=4.2.0'
         'python-cryptography' 'python-precis_i18n' 'python-css-parser'
         'python-distro' 'hicolor-icon-theme' 'python-pillow' 'python-gssapi' 'python-netifaces'
         'python-packaging')
makedepends=('python-build' 'python-installer' 'python-wheel' 'python-setuptools')
optdepends=('farstream: start audio and video chat'
            'gst-plugins-good: for video/voice support'
            'gst-plugins-bad: for video/voice support'
            'gst-plugins-ugly: for video/voice support'
            'gst-libav: for video/voice support'
            'gst-python: for video/voice support'
            'gspell: for spell checking support'
            'geoclue: share current location'
            'libxss: measure idle time, in order to set auto status'
            'python-gnupg: encrypting chat messages with OpenPGP'
            'python-axolotl: OMEMO support'
            'python-qrcode: generate QR codes for OMEMO keys'
            'gsound: Notification Sounds')
source=(https://www.gajim.org/downloads/${_pkgver%.*}/gajim-${_pkgver}.tar.gz)
#source=(https://www.gajim.org/downloads/${_pkgver%.*}/gajim-${_pkgver}-${_fixupver}.tar.gz)
sha512sums=('66135e88784350bab79b61debc1b65144a82f8eee2c1841d21e4f511b3792361e57b60304d2478654e563687e8302426d76063e748236f4e1c959511c7c28665')
b2sums=('c7b8b1dc47b1faf9f1c0803e7931cb00bfbf31075fe481d557ec0f308c79e7580d0054d224781a67eaeea24dba40e40de5faf55d633d71f759022a1ac113f6e4')

build() {
  cd ${pkgname}-${_pkgver}
  ./pep517build/build_metadata.py -o dist/metadata
  python -m build --wheel --no-isolation
}

check() {
  cd ${pkgname}-${_pkgver}
  python -m unittest discover -s test
}

package() {
  cd ${pkgname}-${_pkgver}
  python -m installer --destdir="$pkgdir" dist/*.whl
  ./pep517build/install_metadata.py dist/metadata --prefix="$pkgdir/usr"
}

# vim: ts=2 sw=2 et:
